<template>
  <el-dialog
      v-model="visible"
      :title="`编辑文件: ${filePath}`"
      width="80%"
      height="80%"
      :before-close="handleClose"
  >
    <div style="height: 70vh;">
      <monaco-editor
          v-model:value="editorContent"
          theme="vs-dark"
          :options="{ automaticLayout: true }"
          language="plaintext"
          @change="handleEditorChange"
          style="height: 100%;"
      />
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="visible = false">取消</el-button>
        <el-button type="primary" @click="handleSave" :loading="isSaving">保存</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" src="./SftpEditModal.vue.ts"></script>

<style scoped>
/* 如果需要特定的样式，可以在这里添加 */
</style>